package com.zer0.tga.art;

import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;



public class Screen extends Bitmap{
	 public BufferedImage image;
	// private int xOffset, yOffset;
	
	public Screen(int w, int h) {
        super(w, h);
        image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
        pixel = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
    }
	
	
	public static BufferedImage createCompatibleImage(Image image, int transparency) {
        BufferedImage newImage = createCompatibleImage(image.getWidth(null),image.getHeight(null),transparency);
        Graphics2D g = newImage.createGraphics();
        g.drawImage(image,0,0,null);
        g.dispose();
        return newImage;
}
	
	public static BufferedImage createCompatibleImage(int width, int height, int translucency) {
        return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(width,height,translucency);
}
	
	public Image getImage()
	{
		return createCompatibleImage(image, Transparency.OPAQUE);
	}


	    public void draw(Bitmap bitmap, double x, double y) {
	        super.draw(bitmap, x, y);
	    }

	    public void draw(Bitmap bitmap, double x0, double y0, double x1, double y1) {
	        super.draw(bitmap, x0 , y0, x1, y1);
	    }

	    public void draw(Bitmap bitmap, double x, double y, int color) {
	        super.draw(bitmap, x , y , color);
	    }
	    
	  /*  public void fill(int x, int y, int width, int height, int color) {
	        super.clearWithColor(x, y, width, height, color);
	    }*/

}
